
package com.baijia.commons.tianxiao;

import com.baijia.commons.config.PPWebContext;

public class TianxiaoContext extends PPWebContext{
    
    private static final String ORG_ID = "org_id";
    private static final String ORG_CASCADE_ID = "org_cascade_id";
    private static final String ORG_CASCADE_AUTH = "org_cascade_AUTH";
    
    @Override
    protected void init() {
        //nothing to do
    }
    
    public static void setOrgId(Integer orgId){
        set(ORG_ID, orgId);
    }
    
    public static Integer getOrgId(){
        return get(ORG_ID, Integer.class);
    }
    
    public static void setOrgCascadeId(Long orgCascadeId){
        set(ORG_CASCADE_ID, orgCascadeId);
    }
    
    /**
     * 子帐号登录时才有值，主帐号登录时为空
     * 
     * @return
     */
    public static Long getOrgCascadeId(){
        return get(ORG_CASCADE_ID, Long.class);
    }
    
    public static void setOrgCascadeAuth(String orgCascadeAuth){
        set(ORG_CASCADE_AUTH, orgCascadeAuth);
    }
    
    /**
     * 子帐号登录时才有值，主帐号登录时为空
     * 权限信息为数组，如 '1,2,3'，以','分隔
     * 
     * @return
     */
    public static String getOrgCascadeAuth(){
        return get(ORG_CASCADE_AUTH, String.class);
    }
    
}
